package com.jddup.program.etm;

import com.jddup.common.pojo.TableColumn;
import com.jddup.common.pojo.TableMeta;

/**
 * Created by ZZB on 2017/12/3.
 */
public interface EntityToTableMetaConvertor {
    default < T > TableColumn obtainByFieldName(Class<T> tClass, final String c){
        return convertFromClass(tClass).getTableColumns().stream()
                .filter(t -> t.getColumnName().equals(c) || t.getPropertyName().equals(c)).findFirst().orElse(null);
    }

    < T > TableMeta convertFromClass(Class<T> clazz);
}
